﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
	mc:Ignorable="d"
	x:Class="EIA.SLClient.Utility.Controls.SelectableTreeControl"
	d:DesignWidth="400" d:DesignHeight="300">

	<UserControl.Resources>
		<sdk:HierarchicalDataTemplate x:Key="ViewDataTemplate" ItemsSource="{Binding Children}">
			<Grid>
				<TextBlock Margin="4,0" TextWrapping="Wrap" Text="{Binding Text}" d:LayoutOverrides="Width, Height" VerticalAlignment="Center"
					MouseRightButtonDown="TreeViewMain_MouseRightButtonDown"
					MouseRightButtonUp="TreeViewMain_MouseRightButtonUp"
					MouseLeftButtonDown="TreeViewMain_MouseLeftButtonDown"/>
			</Grid>
		</sdk:HierarchicalDataTemplate>
	</UserControl.Resources>

	<Grid x:Name="LayoutRoot">
		<sdk:TreeView x:Name="TreeViewMain" ItemTemplate="{StaticResource ViewDataTemplate}"
			MouseRightButtonDown="TreeViewMain_MouseRightButtonDown"
			MouseRightButtonUp="TreeViewMain_MouseRightButtonUp"
			MouseLeftButtonDown="TreeViewMain_MouseLeftButtonDown"
            MouseLeave="TreeViewMain_MouseLeave"
            MouseEnter="TreeViewMain_MouseEnter"
			SelectedItemChanged="TreeViewMain_SelectedItemChanged" Background="#00FFFFFF" BorderThickness="0"/>
	</Grid>
</UserControl>